package com.example.shardingjdbc.controller;

import com.example.shardingjdbc.entity.User;
import com.example.shardingjdbc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @Description :
 * @Author : Bruce Lee
 * @CreateTime : 2024/5/21
 */



@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/insert")
    public void insert()
    {

        User user = new User();
        user.setName("李四");
        user.setAge(22);
        userService.insert(user);
    }
}
